import path from 'path'

import badger, {log} from '@codefree/badger/service'

const logger = log.getLogger();

const nodeEnv = process.env.NODE_ENV || 'dev';
const config = require(path.normalize(__dirname + '/config/config.' + nodeEnv + ".js"));

config.db.options.logging = true;
const badgerApp = new badger(config);
badgerApp.createApplication();
badgerApp.context.db.sync({force: true}).then(()=>{
    process.exit(0);
});